#include "Timestamp.h"
#include<time.h>



Timestamp Timestamp::now(){
    return Timestamp(time(NULL));
}
std::string Timestamp::tostring()const {
    char buff[1024] = {0};
    tm *time = localtime(&microSecondsSinceEpoch_);
    snprintf(buff, 1024, "%4d-%02d-%02d %02d:%02d:%02d", 
        time->tm_year + 1900,
        time->tm_mon + 1,
        time->tm_mday,
        time->tm_hour,
        time->tm_min,
        time->tm_sec);
    return buff;
}



